<template>
  <el-card id="confrencing-item" shadow="hover">
      <div class="topbar"></div>
    <div class="content">
      <img src="../../assets/icon/_s-视频icon.png">
      <div class="con-name">
        {{room.roomName}}
        <br>
        <span class="create-info">创建人：{{ room.realName }}</span>
      </div>
      <el-button plain>
        <a
          target="_blank"
          :href="'https://192.168.30.25:8440/?roomId='+
                                               room.roomId +
                                               '&userName='+ room.realName +
                                               '&cert=' + room.roomCert"
        >进入会议</a>
      </el-button>
      <div class="people-info">参与人数:{{ room.peapleList.length }}人</div>
      <div class="con-info">{{type}}</div>
    </div>
    <div class="footer">
      <div class="create-time">
        创建时间：
        <img src="../../assets/icon/time_icon.png">
        {{room.creatTime.substr(0,10)}}
      </div>
      <div class="peoples">
        <el-popover  placement="bottom" trigger="hover" v-if="room.peapleList.length>3" popper-class="meetingpopper">
          <el-card class="box-card" shadow="never">
            <div slot="header" class="clearfix">
              <span>全部与会人员</span>
            </div>
            <div class="item-content">
              <div v-for="(v,i) in room.peapleList" :key="i" class="pd-item">
                <span>
                  <img :src="v.headImg">
                  <br>
                  {{v.realName}}
                </span>
                <div>
                  <i class="create-info">公司：</i>
                  {{ v.company }}
                  <br>
                  <i class="create-info">部门：</i>
                  {{ v.department }}
                  <br>
                  <i class="create-info">职位：</i>
                  {{ v.job }}
                </div>
              </div>
            </div>
          </el-card>

          <template slot="reference">
            <img src="../../assets/icon/morepeople.png">
          </template>
        </el-popover>
        <template v-for="(value,ii) in room.peapleList">
          <el-popover
            popper-class="meetingpopper"
            class="people-details"
            trigger="hover"
            placement="bottom"
            :key="ii"
            v-if="ii<=2"
          >
            <el-card class="box-card1" shadow="never">
              <div slot="header" class="clearfix">
                <img :src="value.headImg">
                <div class="con-name">
                  {{ value.realName }}
                  <br>
                  <span class="create-info">{{ value.job }}</span>
                </div>
              </div>
              <div class="pd-item">
                <span class="create-info">公司：</span>
                {{value.company}}
                <br>
                <span class="create-info">部门：</span>
                {{value.department}}
              </div>
            </el-card>
            <template slot="reference">
              <img :src="value.headImg">
            </template>
          </el-popover>
        </template>
      </div>
    </div>
  </el-card>
</template>
<script>
export default {
  name: "ConfrencingListCard",
  props: {
    room: Object, // 会议信息对象 内含会议人员信息数组
    type: String // 会议类型 "我创建的" "我参与的"
  },
  data() {
    return {};
  },
  created() {},
  methods: {}
};
</script>
<style lang="scss">
    #confrencing-item{
        .el-card__body{
            padding:0 !important;
            margin: 0 !important;
        }
    }
</style>
<style lang = "scss" scoped>
.people-details {
  img {
    width: 32px;
    border-radius: 50%;
  }
}
// 参会人员列表卡片
.box-card {
  cursor: default;
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 0;
  width: 350px;
  .clearfix {
    height: 16px;
    margin: 0;
    padding: 0;
    text-align: center;
    line-height: 16px;
    font-size: 16px;
    img {
      width: 32px;
      height: 32px;
      border-radius: 50%;
    }
  }
  .pd-item {
    display: block;
    height: 54px;
    margin-top: 2px;
    padding-bottom: 2px;
    padding-top: 2px;
    border-bottom: 1px solid rgba(238, 238, 238, 1);
    position: relative;
    font-size: 12px;
    font-family: SourceHanSansCN-Regular;
    font-weight: 400;
    color: rgba(43, 43, 43, 1);
    .create-info {
      font-size: 12px;
      font-family: SourceHanSansCN-Regular;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    span {
      margin: 0 2px;
      display: block;
      position: absolute;
      img {
        width: 34px;
        height: 34px;
        border-radius: 50%;
      }
    }
    div {
      height: 50px;
      position: absolute;
      left: 70px;
    }
  }
}
// 参会人员信息详情卡片
.box-card1 {
  cursor: default;
  margin: 0;
  padding: 0;
  width: 293px;
  height: 180px;
  .clearfix {
    height: 20px;
    margin: 0;
    padding: 0;
    border: none;
    height: 52px;
    position: relative;
    img {
      width: 52px;
      height: 52px;
      border: 1px solid rgba(238, 238, 238, 1);
      border-radius: 50%;
    }
    .con-name {
      display: block;
      position: absolute;
      top: 9px;
      left: 64px;
      height: 16px;
      font-size: 14px;
      font-family: SourceHanSansCN-Regular;
      font-weight: 400;
      color: rgba(43, 43, 43, 1);
      .create-info {
        font-size: 14px;
        font-family: SourceHanSansCN-Regular;
        font-weight: 400;
        color: rgba(153, 153, 153, 1);
      }
    }
  }
  .pd-item {
    height: 70px;
    font-size: 13px;
    font-family: SourceHanSansCN-Regular;
    font-weight: 400;
    color: rgba(43, 43, 43, 1);
    .create-info {
      font-size: 13px;
      font-family: SourceHanSansCN-Regular;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
  }
}
#confrencing-item {
  float: left;
  margin-left: 20px;
  margin-top: 20px;
  padding:0;
  height: 200px;
  width: 480px;
  border: 1px solid rgba(238, 238, 238, 1);
  .topbar {
    height: 8px;
    background: rgba(84, 157, 232, 1);
  }
  .content {
    position: relative;
    margin-left: 22px;
    margin-right: 22px;
    height: 120px;
    border-bottom: 1px solid rgba(238, 238, 238, 1);
    .el-button a {
      color: #fff;
      font-weight: 700;
    }
    .con-name {
      display: block;
      position: absolute;
      top: 20px;
      left: 56px;
      height: 16px;
      font-size: 16px;
      font-family: SourceHanSansCN-Regular;
      font-weight: 400;
      color: rgba(43, 43, 43, 1);
      .create-info {
        font-size: 14px;
        font-family: SourceHanSansCN-Regular;
        font-weight: 400;
        color: rgba(153, 153, 153, 1);
      }
    }

    .el-button {
      position: absolute;
      top: 18px;
      right: 0;
      width: 115px;
      height: 40px;
      background: rgba(84, 157, 232, 1);
      border-radius: 4px;
      font-size: 14px;
      font-family: SourceHanSansCN-Regular;
      font-weight: 400;
      color: rgba(255, 255, 255, 1);
    }
    .el-button:focus {
      background: rgba(84, 157, 232, 0.8);
    }
    .el-button:hover {
      background: rgba(84, 157, 232, 0.8);
    }
    img {
      position: absolute;
      top: 18px;
    }
    .con-info {
      position: absolute;
      top: 70px;
      line-height: 28px;
      text-align: center;
      width: 77px;
      height: 28px;
      border: 1px solid rgba(238, 238, 238, 1);
      border-radius: 14px;
      font-size: 14px;
      font-family: SourceHanSansCN-Regular;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    .people-info {
      width: 100px;
      height: 14px;
      font-size: 14px;
      font-family: SourceHanSansCN-Regular;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      position: absolute;
      top: 95px;
      right: 0;
    }
  }
  .footer {
    position: relative;
    height: 80px;
    .create-time {
      position: absolute;
      line-height: 30px;
      top: 20px;
      left: 22px;
      width: 200px;
      height: 30px;
      background: rgba(240, 247, 255, 1);
      border-radius: 15px;
      font-size: 14px;
      font-family: SourceHanSansCN-Regular;
      font-weight: 400;
      color: rgba(84, 157, 232, 1);
      text-align: center;
      img {
        height: 12px;
        padding-right: 2px;
      }
    }
    .peoples {
      span {
        display: block;
        float: right;
        margin-top: 18px;
        margin-right: 12px;
        width: 34px;
        height: 34px;
        border: 1px solid rgba(238, 238, 238, 1);
        border-radius: 50%;
        img {
          width: 34px;
          height: 34px;
        }
      }
      .sp1 {
        cursor: pointer;
      }
    }
  }
}
</style>
